<div class="properties-rows">
<div class="row"><?php foreach ($agents as $listing) { ?>
<div class="agent span9">
	<div class="row">
		<div class="image span2">
			<div class="content">
				<?php  
				$isPhoto = $this->mdl_findanexpert->isAgentPhoto($listing['agent_id']);
				?>
				<?php if($isPhoto) { ?>
				<img src="<?php echo base_url(); ?>findanexpert/getAgentProfilePhoto/<?php echo $listing['agent_id'];?>">
				<?php } else { ?>
				<img src="<?php echo $this->config->item('HTTP_AGENTS_MEDIA_IMAGE'); ?>no-image.jpg" />
				<?php } ?>
			</div>
			<!-- /.content -->
		</div>
		<!-- /.image -->
		<div class="body span7">
			<div class="row-fluid">
				<div class="title-price title-agent span12">
					<div class="title">
						<h2>
							<a href="<?php echo  base_url(); ?>find-an-expert/detail/<?php echo $listing['agent_id']; ?>"><?php echo $listing['busniessname']; ?></a>
						</h2>
					</div>
					<!-- /.title -->
				</div>
				<!-- /.title -->
			</div>
			<div class="row-fluid">
				<div class="title-agent span6 offset1">
					<div class="title">
						<p><?php echo sprintf($text_cea_reg_num, $listing['AgentLicenceNo']); ?></p>
					</div>
					<div class="mobile">
						<a href="javascript:void();"><?php echo $listing['mobile']; ?></a>
					</div>
					<div class="title">
						<?php if($listing['LicenceNo'] == "L3010359I") { ?>
						<?php echo $text_company_agent; ?>
						<?php } else { ?>
						<?php echo sprintf($text_broker_with, ''); ?>
						<?php } ?>
					</div>
					<div class="title">
						<p><?php echo sprintf($text_cea_com_num, $listing['LicenceNo']); ?></p>
					</div>
					<!-- /.location -->
				</div>
				<!-- /.title -->
				<div class="title-agent span2">
					<div class="status">
						
					</div>
					<?php if($listing['total_listing'] > 0) { ?>
					<div class="status">
						<?php echo $listing['total_listing']; ?> Active listings
					</div>
					<?php } ?>
				</div>
				<div class="span3">
					<button class="btn btn-primary find_an_expert_btn" data-toggle="modal" data-target="#myModal_<?php echo $listing['agent_id']; ?>"><?php echo $text_contact_this_agent; ?></button>
					<?php if($listing['recommendations'] > 0) { ?>
					<div class="control-group media">
						<label class="control-label">
						<?php echo $listing['recommendations']; ?> Recommandations 
						</label>
					</div>
					<?php } ?>
					<input type="hidden" value="<?php echo $listing['agent_id']; ?>" name="findanexpert" id="findanexpert">
				</div>
				<div id="myModal_<?php echo $listing['agent_id']; ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
					<form method="post" action="?" id="validate_field_contact_agent_result" class="button-contact-agent-find-an-expert">
						<input type="hidden" name="agent_email" value="<?php echo $listing['email']; ?>">
						<input type="hidden" name="agent_id" value="<?php echo $listing['agent_id']; ?>" class="agent_id">
						<input type="hidden" name="action" value="sendenquiry" />
						<div class="modal-header">
						  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						  <h3 id="myModalLabel"><?php echo $text_contact_this_agent; ?></h3>
						  <div class="message_notification"></div>
						</div>
						<div class="modal-body">
							<div class="content">
						  		<div class="row-fluid">
						  			<div class="image span4">
						  				<?php  
										$isPhoto = $this->mdl_findanexpert->isAgentPhoto($listing['agent_id']);
										?>
						  				<?php if($isPhoto) { ?>
										<img src="<?php echo base_url(); ?>findanexpert/getAgentProfilePhoto/<?php echo $listing['agent_id'];?>">
										<?php } else { ?>
										<img src="<?php echo $this->config->item('HTTP_AGENTS_MEDIA_IMAGE'); ?>no-image.jpg" />
										<?php } ?>
						  			</div>
						  			<div class="body span8">
						  				<h3><?php echo $listing['busniessname']; ?></h3>
						  				<p><?php echo sprintf($text_cea_reg_num, $listing['AgentLicenceNo']); ?></p>
						  				<p><a><?php echo $listing['mobile']; ?></a></p>
						  				<?php if($listing['LicenceNo'] == "L3010359I") { ?>
										<p><?php echo $text_company_agent; ?></p>
										<?php } else { ?>
										<p><?php echo sprintf($text_broker_with, ''); ?></p>
										<?php } ?>
										<p><?php echo sprintf($text_cea_com_num, $listing['LicenceNo']); ?></p>
						  			</div>
						  		</div>
					  			<div class="row-fluid">
					  				<div class="span4">
					  					<div class="row-fluid">
					  						<div class="span12">
							  					<div class="control-group">
							  						<div class="controls">
							  							<input type="text" name="name" id="name" class="span12 agent_name" maxlength="20" value="Name">
							  						</div>
							  					</div>
							  				</div>
							  			</div>
					  				</div>
					  				<div class="span4">
					  					<div class="row-fluid">
					  						<div class="span12">
							  					<div class="control-group">
							  						<div class="controls">
							  							<input type="text" name="phone" id="phone" class="span12 agent_phone" maxlength="20" value="Phone">
							  						</div>
							  					</div>
							  				</div>
							  			</div>
					  				</div>
					  				<div class="span4">
					  					<div class="control-group">
					  						<div class="controls">
					  							<input type="text" name="email" id="email" class="span12 agent_email" maxlength="20" value="Email">
					  						</div>
					  					</div>
					  				</div>
					  			</div>
					  			<div class="row-fluid">
					  				<textarea class="span12" name="message" id="message" cols="70" rows="3">Hello <?php echo $listing['busniessname']; ?>, I saw your listing on the Singapore website and am interested to find out more. Please contact me via email to schedule a meeting. Thank you.</textarea>
					  			</div>
							</div>
						</div>
						<div class="modal-footer">
						  <button class="btn btn-primary">Send</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	<!-- /.body -->
	</div>
<!-- /.property --></div>
<!-- /.row --> <?php } ?></div>
<!-- /.row --></div>
<!-- /.properties-rows -->
